package cn.edu.cqu.bysj.wm.gui.component;

import java.awt.BorderLayout;

import javax.swing.JTextArea;

import cn.edu.cqu.bysj.wm.gui.model.AlgorithmConfig;
import cn.edu.cqu.bysj.wm.gui.result.SolutionsResult;
import cn.edu.cqu.bysj.wm.gui.table.SolutionView;

public class LPSolutionsAlgorithmTabPane extends AlgorithmTabPane {

	LPSolutionsTabContent content = new LPSolutionsTabContent();

	/**
	 * create lp solutions tab
	 */
	public LPSolutionsAlgorithmTabPane(String _title,
			AlgorithmConfig _configure) {
		super(1, _title, _configure);

		setLayout(new BorderLayout(0, 0));
		splitPane.setLeftComponent(content);
		splitPane.setDividerSize(0);
		add(splitPane);
	}

	@Override
	public void showResult() {
		SolutionsResult temp = (SolutionsResult) result;
		SolutionView sView = new SolutionView("不同Solution比较");
		content.getTable().add(sView);
		sView.initDatas(temp.getSolutionRows());
		JTextArea area = new JTextArea();
		area.setText(temp.getMatrix().toString());
		content.getMatrix().add(area, BorderLayout.CENTER);

	}

}
